<?php

/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Badge
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
 
?>
  <div class="quicklinks badges_categories_quicklinks">
    <ul>
    <?php foreach ($this->categories as $category): ?>
      <li>
        <?php 
          $attrs = array();
          if ($this->show_photo) {
            $attrs['class'] = 'buttonlink icon_badge_category';
            if ($category->photo_id) {
              $attrs['style'] = "background-image: url(".$category->getPhotoUrl('thumb.mini').");";
            }
          }
          echo $this->htmlLink($category->getHref(), $category->getTitle(), $attrs
        );?>
          <?php if ($this->show_details): ?>
            <div class="badge_category_desc">
              <?php echo $this->radcodes()->text()->truncate($category->getDescription(), $this->descriptionlength); ?>
            </div>
          <?php endif; ?>
      </li>
    <?php endforeach; ?>
    </ul>
  </div>
